/*
 * Libwrapper.h
 *
 *  Created on: 2013-6-11
 *      Author: wb
 */

#ifndef LIBWRAPPER_H_
#define LIBWRAPPER_H_
#include <string>
#include <sstream>
#include <set>
#include <deque>
#include <vector>
#include <stdint.h>
namespace s2e {
namespace plugins {
struct transferstate
{
	 std::deque<bool> m_forkrecord;
	 std::deque<bool> m_forkrecord4repaly;
	 std::deque<uint64_t> m_forkPoints; //记录分支时候的pc
	 std::deque<uint64_t> m_concreteAddressSequence; //在符号化内存读写的时候,记录当前的选择
	 std::deque<uint64_t> m_concreteAddressSequence4repaly; //在符号化内存读写的时候,记录当前的选择
	 //是否正在重播，当m_forkrecord4repaly变为空时，请将其设为false
	 //bool m_replaying;
	//	 bool m_isSpeculative;
};
struct file_dlib {
	long file_size;
	std::string name;
	std::string full_name;
};
class Libwrapper {
public:
	Libwrapper();
	virtual ~Libwrapper();

	void init();
	bool file_exists(const std::string& filename);
	std::vector<file_dlib> getfiles(std::string dirloc);
	void sleep( unsigned long milliseconds);

	void serialize(const transferstate& item, std::ostream& out);
	void deserialize(transferstate& item, std::istream& in);

};
}
} /* namespace s2e */
#endif /* LIBWRAPPER_H_ */
